/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * BooksView.java
 *
 * Created on Feb 28, 2010, 12:39:17 PM
 */
package iterc;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import cmsc128.proj.iterc.dao.Book;
import javax.swing.DefaultListModel;
import java.util.List;
/**
 *
 * @author Joan
 */
public class BooksView extends javax.swing.JFrame {

    int selectedindex;
    public void reloadBookList() {
        saveButton.setVisible(false);
        updateBookButton.setEnabled(false);
        deleteBookButton.setEnabled(false);
        bookList.removeAllElements();
        if(s != null) {
            java.util.Iterator e = s.iterator();
            while (e.hasNext()) {
                cmsc128.proj.iterc.dao.Book book = new cmsc128.proj.iterc.dao.Book();
                book = (cmsc128.proj.iterc.dao.Book)e.next();
                String disp = (book.getIsbn()) + " - " + book.getTitle() + ", " + book.getAuthor() + ", " + book.getPublisher();
                bookList.addElement(disp);
            }
        }
    }
     
    public void reloadBookArrayList() {
        s = new java.util.ArrayList<cmsc128.proj.iterc.dao.Book>(cmsc128.proj.iterc.dao.BookPeer.viewBooks());
    }
   /* public void searchBookArrayList() {
        s = new Book (cmsc128.proj.iterc.dao.BookPeer.searchBooks());
    }*/

    public void reloadAvailableBookArrayList() {
        s = new java.util.ArrayList<cmsc128.proj.iterc.dao.Book>(cmsc128.proj.iterc.dao.BookPeer.viewAvailableBooks());
    }

    public void reloadDueBookArrayList() {
        s = new java.util.ArrayList<cmsc128.proj.iterc.dao.Book>(cmsc128.proj.iterc.dao.BookPeer.viewDueBooks());
    }

    public void reloadBorrowedBookArrayList() {
        s = new java.util.ArrayList<cmsc128.proj.iterc.dao.Book>(cmsc128.proj.iterc.dao.BookPeer.viewBorrowedBooks());
    }
    /** Creates new form BooksView */
    public BooksView() {
        initComponents();
        viewIdField.setEditable(false);
        viewIsbnField.setEditable(false);
        viewStatusField.setEditable(false);
        viewPublisherField.setEditable(false);
        viewTitleField.setEditable(false);
        viewAuthorField.setEditable(false);
        //viewYearPublishedField.setEditable(false);
        //viewDateAcquiredField.setEditable(false);
        //dayBox2.setVisible(false);
        //monthBox2.setVisible(false);
        yearBox2.setVisible(false);
        dayBox3.setVisible(false);
        monthBox3.setVisible(false);
        yearBox3.setVisible(false);
        //dayBox2.setSelectedIndex(0);
        //monthBox2.setSelectedIndex(0);
        //yearBox2.setSelectedIndex(0);
        //dayBox3.setSelectedIndex(0);
        //monthBox3.setSelectedIndex(0);
        //yearBox3.setSelectedIndex(0);
        viewIdField.setBorder(null);
        viewIsbnField.setBorder(null);
        viewStatusField.setBorder(null);
        viewPublisherField.setBorder(null);
        viewTitleField.setBorder(null);
        viewAuthorField.setBorder(null);
        //viewYearPublishedField.setBorder(null);
        //viewDateAcquiredField.setBorder(null);
        //saveButton.disable();
        this.reloadBookList();
        javax.swing.event.ListSelectionListener listSelectionListener = new javax.swing.event.ListSelectionListener() {

            public void valueChanged(javax.swing.event.ListSelectionEvent listSelectionEvent) {
                cmsc128.proj.iterc.dao.Book book = new cmsc128.proj.iterc.dao.Book();

                if(booksList.getSelectedIndex() != -1) {
                    int index = booksList.getSelectedIndex();
                    book = s.get(index);
                    viewIdField.setText(Integer.toString(book.getId()));
                    viewIsbnField.setText(book.getIsbn());
                    viewStatusField.setText(book.getStatus());
                    viewPublisherField.setText(book.getPublisher());
                    viewTitleField.setText(book.getTitle());
                    viewAuthorField.setText(book.getAuthor());
                
                    //String y = book.getYear_published().toString();
                    //String[] a = y.split("-", -2);
                    //String[] c = a[2].split(" ", -1);

                    //dayBox2.setVisible(true);
                    //dayBox2.setEnabled(false);
                    //dayBox2.setSelectedItem(a[1]);
                    //monthBox2.setVisible(true);
                    //monthBox2.setEnabled(false);
                    //monthBox2.setSelectedItem(c[0]);


                    yearBox2.setVisible(true);
                    yearBox2.setEnabled(false);
                    //yearBox2.setSelectedItem();

                    String d = book.getDate_acquired().toString();
                    String[] b = d.split("-", -2);
                    String[] cc = b[2].split(" ", -1);

                    dayBox3.setVisible(true);
                    dayBox3.setEnabled(false);
                    dayBox3.setSelectedItem(b[1]);
                    monthBox3.setVisible(true);
                    monthBox3.setEnabled(false);
                    monthBox3.setSelectedItem(cc[0]);
                    yearBox3.setVisible(true);
                    yearBox3.setEnabled(false);
                    yearBox3.setSelectedItem(b[0]);

                }

                    updateBookButton.setEnabled(true);
                    deleteBookButton.setEnabled(true);
            }
        };
        booksList.addListSelectionListener(listSelectionListener);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jTextField1 = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        booksList = new javax.swing.JList(bookList);
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        deleteBookButton = new javax.swing.JButton();
        searchBookButton = new javax.swing.JButton();
        updateBookButton = new javax.swing.JButton();
        viewIdField = new javax.swing.JTextField();
        viewIsbnField = new javax.swing.JTextField();
        viewStatusField = new javax.swing.JTextField();
        viewPublisherField = new javax.swing.JTextField();
        viewTitleField = new javax.swing.JTextField();
        viewAuthorField = new javax.swing.JTextField();
        viewAllBookButton = new javax.swing.JButton();
        jComboBox1 = new javax.swing.JComboBox();
        saveButton = new javax.swing.JButton();
        yearBox2 = new javax.swing.JComboBox();
        yearBox3 = new javax.swing.JComboBox();
        monthBox3 = new javax.swing.JComboBox();
        dayBox3 = new javax.swing.JComboBox();
        addAddressLabel1 = new javax.swing.JLabel();
        addCourseLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        addStudNoLabel = new javax.swing.JLabel();
        addLastNameLabel = new javax.swing.JLabel();
        addFirstNameLabel = new javax.swing.JLabel();
        addMidInitLabel = new javax.swing.JLabel();
        addCollegeLabel = new javax.swing.JLabel();
        addCourseLabel = new javax.swing.JLabel();
        addAddressLabel = new javax.swing.JLabel();
        addIsbnField = new javax.swing.JTextField();
        addStatusField = new javax.swing.JTextField();
        addPublisherField = new javax.swing.JTextField();
        addTitleField = new javax.swing.JTextField();
        addAuthorField = new javax.swing.JTextField();
        addStudButton = new javax.swing.JButton();
        resetAddStudFieldsButton = new javax.swing.JButton();
        yearBox = new javax.swing.JComboBox();
        yearBox1 = new javax.swing.JComboBox();
        monthBox1 = new javax.swing.JComboBox();
        dayBox1 = new javax.swing.JComboBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jTabbedPane2.setFont(jTabbedPane2.getFont());

        jTextField1.setText("Enter query here (Title or Author)");
        jTextField1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField1ActionPerformed(evt);
            }
        });

        jLabel1.setText("Search by:");

        jScrollPane1.setViewportView(booksList);

        jScrollPane3.setViewportView(jScrollPane1);

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel2.setText("BOOK INFORMATION");

        jLabel3.setText("ID:");

        jLabel4.setText("ISBN:");

        jLabel5.setText("STATUS:");

        jLabel6.setText("PUBLISHER:");

        jLabel7.setText("TITLE:");

        jLabel8.setText("AUTHOR:");

        deleteBookButton.setLabel("Delete Book");
        deleteBookButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteBookButtonActionPerformed(evt);
            }
        });

        searchBookButton.setText("Search");
        searchBookButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                searchBookButtonActionPerformed(evt);
            }
        });

        updateBookButton.setText("Update Book");
        updateBookButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                updateBookButtonActionPerformed(evt);
            }
        });

        viewIdField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewIdFieldActionPerformed(evt);
            }
        });

        viewStatusField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewStatusFieldActionPerformed(evt);
            }
        });

        viewAllBookButton.setText("View All Books");
        viewAllBookButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                viewAllBookButtonActionPerformed(evt);
            }
        });

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "View By...", "View Available Books", "View Due Books", "View Borrowed Books" }));
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        saveButton.setText("Save");
        saveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveButtonActionPerformed(evt);
            }
        });

        java.util.ArrayList<String> years3 = new java.util.ArrayList<String>();
        for(int i=1980; i<2100; i++) {
            years3.add(""+i);
        }
        yearBox2.setModel(new javax.swing.DefaultComboBoxModel(years3.toArray()));

        java.util.ArrayList<String> years4 = new java.util.ArrayList<String>();
        for(int i=1980; i<2100; i++) {
            years4.add(""+i);
        }
        yearBox3.setModel(new javax.swing.DefaultComboBoxModel(years4.toArray()));

        monthBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
            "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"
        }));

        dayBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}));

        addAddressLabel1.setText("DATE ACQUIRED:");

        addCourseLabel1.setText("YEAR PUBLISHED:");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(searchBookButton))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(viewAllBookButton)
                                .addGap(18, 18, 18)
                                .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(addCourseLabel1)
                                    .addComponent(addAddressLabel1))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(dayBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(monthBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(yearBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(yearBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(deleteBookButton)
                                .addGap(18, 18, 18)
                                .addComponent(updateBookButton)
                                .addGap(18, 18, 18)
                                .addComponent(saveButton))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel6)
                                    .addComponent(jLabel7)
                                    .addComponent(jLabel8))
                                .addGap(39, 39, 39)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(viewAuthorField, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                                    .addComponent(viewTitleField, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                                    .addComponent(viewPublisherField, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                                    .addComponent(viewStatusField, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                                    .addComponent(viewIdField, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                                    .addComponent(viewIsbnField, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)
                                    .addComponent(jLabel2))))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(13, 13, 13)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(searchBookButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(viewIdField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(viewIsbnField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(viewStatusField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(viewPublisherField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(viewTitleField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(viewAuthorField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(addCourseLabel1)
                            .addComponent(yearBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(addAddressLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(yearBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(monthBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(dayBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(viewAllBookButton)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(saveButton)
                    .addComponent(updateBookButton)
                    .addComponent(deleteBookButton))
                .addContainerGap())
        );

        jTabbedPane2.addTab("View Books", jPanel1);

        addStudNoLabel.setText("ISBN:");

        addLastNameLabel.setText("STATUS:");

        addFirstNameLabel.setText(" PUBLISHER:");

        addMidInitLabel.setText("TITLE:");

        addCollegeLabel.setText("AUTHOR:");

        addCourseLabel.setText("YEAR PUBLISHED");

        addAddressLabel.setText("DATE ACQUIRED:");

        addStudButton.setText("Add");
        addStudButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addStudButtonActionPerformed(evt);
            }
        });

        resetAddStudFieldsButton.setText("Reset Fields");
        resetAddStudFieldsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resetAddStudFieldsButtonActionPerformed(evt);
            }
        });

        java.util.ArrayList<String> years2 = new java.util.ArrayList<String>();
        for(int i=1980; i<2100; i++) {
            years2.add(""+i);
        }
        yearBox.setModel(new javax.swing.DefaultComboBoxModel(years2.toArray()));
        yearBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                yearBoxActionPerformed(evt);
            }
        });

        java.util.ArrayList<String> years = new java.util.ArrayList<String>();
        for(int i=1980; i<2100; i++) {
            years.add(""+i);
        }
        yearBox1.setModel(new javax.swing.DefaultComboBoxModel(years.toArray()));

        monthBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
            "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"
        }));

        dayBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(addMidInitLabel)
                            .addComponent(addFirstNameLabel)
                            .addComponent(addLastNameLabel)
                            .addComponent(addCollegeLabel)
                            .addComponent(addCourseLabel)
                            .addComponent(addAddressLabel)
                            .addComponent(addStudNoLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(yearBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(dayBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(monthBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(yearBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(addIsbnField, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
                            .addComponent(addStatusField, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
                            .addComponent(addPublisherField, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
                            .addComponent(addTitleField, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)
                            .addComponent(addAuthorField, javax.swing.GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(addStudButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(resetAddStudFieldsButton)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addStudNoLabel)
                    .addComponent(addIsbnField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addLastNameLabel)
                    .addComponent(addStatusField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addFirstNameLabel)
                    .addComponent(addPublisherField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addMidInitLabel)
                    .addComponent(addTitleField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addCollegeLabel)
                    .addComponent(addAuthorField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addCourseLabel)
                    .addComponent(yearBox, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addAddressLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dayBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(monthBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(yearBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addStudButton)
                    .addComponent(resetAddStudFieldsButton))
                .addContainerGap(115, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Add Book", jPanel2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 665, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane2)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jTextField1ActionPerformed

    private void deleteBookButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteBookButtonActionPerformed
        if (JOptionPane.showConfirmDialog(null, "Are you sure you want to delete?", "Delete Book", JOptionPane.OK_CANCEL_OPTION) == 0){
        cmsc128.proj.iterc.dao.Book book = new cmsc128.proj.iterc.dao.Book();
        int index = booksList.getSelectedIndex();
        book = s.get(index);
        s.remove(index);
        //JOptionPane.showConfirmDialog(null, "Are you sure you want to delete?", "Delete Book", JOptionPane.OK_CANCEL_OPTION);
        cmsc128.proj.iterc.dao.BookPeer.deleteBook(book.getId());
        bookList.remove(index);
        }
        deleteBookButton.setEnabled(false);
        updateBookButton.setEnabled(false);
        viewIdField.setText(null);
        viewIsbnField.setText(null);
        viewStatusField.setText(null);
        viewPublisherField.setText(null);
        viewTitleField.setText(null);
        viewAuthorField.setText(null);
        //viewYearPublishedField.setText(null);
        //viewDateAcquiredField.setText(null);
        //dayBox2.setSelectedIndex(0);
        //monthBox2.setSelectedIndex(0);
        yearBox2.setVisible(false);
        dayBox3.setVisible(false);
        monthBox3.setVisible(false);
        yearBox3.setVisible(false);
        /*yearBox2.setSelectedIndex(0);
        dayBox3.setSelectedIndex(0);
        monthBox3.setSelectedIndex(0);
        yearBox3.setSelectedIndex(0);*/

}//GEN-LAST:event_deleteBookButtonActionPerformed

    private void searchBookButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_searchBookButtonActionPerformed
        String search = jTextField1.getText();
        //cmsc128.proj.iterc.dao.Book book = new cmsc128.proj.iterc.dao.Book();
        if((cmsc128.proj.iterc.dao.BookPeer.searchBook(search)) == null){
        JOptionPane.showMessageDialog(null, "No input value.", "Search Book", 1);
        //System.out.println("Pumasok dito");
        //String display = "No results found.";
        //bookList.setText(display);
        //String search = jTextField1.getText();
        //cmsc128.proj.iterc.dao.BookPeer.searchBook(search);
        //this.reloadBookList();
        }
        else {
        s = new java.util.ArrayList<cmsc128.proj.iterc.dao.Book>(cmsc128.proj.iterc.dao.BookPeer.searchBook(search));
        this.reloadBookList();
        }
}//GEN-LAST:event_searchBookButtonActionPerformed

    private void updateBookButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateBookButtonActionPerformed
        //viewIdField.setEditable();
        viewIsbnField.setEditable(true);
        viewStatusField.setEditable(true);
        viewPublisherField.setEditable(true);
        viewTitleField.setEditable(true);
        viewAuthorField.setEditable(true);
        //dayBox2.setSelectedItem(evt);
        //dayBox3.setSelectedItem(evt);
        //viewYearPublishedField.setEditable(true);
        //viewDateAcquiredField.setEditable(true);
        //dayBox2.setEnabled(true);
        //monthBox2.setEnabled(true);
        yearBox2.setEnabled(true);
        dayBox3.setEnabled(true);
        monthBox3.setEnabled(true);
        yearBox3.setEnabled(true);
        viewAllBookButton.setEnabled(false);
        searchBookButton.setEnabled(false);
        deleteBookButton.setEnabled(false);
        jComboBox1.setEnabled(false);
        booksList.setEnabled(false);
        jTextField1.setEnabled(false);
        jTabbedPane2.setEnabled(false);
        updateBookButton.setVisible(false);
        saveButton.setVisible(true);
}//GEN-LAST:event_updateBookButtonActionPerformed

    private void viewIdFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewIdFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_viewIdFieldActionPerformed

    private void viewStatusFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewStatusFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_viewStatusFieldActionPerformed

    private void viewAllBookButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewAllBookButtonActionPerformed
        this.reloadBookArrayList();
        this.reloadBookList();
}//GEN-LAST:event_viewAllBookButtonActionPerformed

    private void addStudButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudButtonActionPerformed
        
        String year_published = yearBox.getSelectedItem().toString();
        String date_acquired = monthBox1.getSelectedItem().toString() + "/" + dayBox1.getSelectedItem().toString() + "/" + yearBox1.getSelectedItem().toString();

        if (cmsc128.proj.iterc.dao.BookPeer.addBook(addIsbnField.getText(), addStatusField.getText(), addPublisherField.getText(), addTitleField.getText(), addAuthorField.getText(), year_published, date_acquired) == false)
        {

        JOptionPane.showMessageDialog(null, "Missing Field", "Error", 1);

        }
        else
        {

        JOptionPane.showMessageDialog(null, "Book Added", "Add Book", 1);
        String disp = addIsbnField.getText() + " - " + addTitleField.getText() + ", " + addAuthorField.getText() + ", " + addPublisherField.getText();
        bookList.addElement(disp);
        cmsc128.proj.iterc.dao.Book book = new cmsc128.proj.iterc.dao.Book();
        book.setIsbn(addIsbnField.getText());
        book.setStatus(addStatusField.getText());
        book.setPublisher(addPublisherField.getText());
        book.setTitle(addTitleField.getText());
        book.setAuthor(addAuthorField.getText());
        book.setYear_published(year_published);

        java.text.DateFormat df = new java.text.SimpleDateFormat("MM/dd/yyyy");

            try {
                //java.util.Date yp = df.parse(year_published);
                //book.setYear_published(yp);
                java.util.Date da = df.parse(date_acquired);
                book.setDate_acquired(da);
            } catch(Exception e) {
                // try {
                //     java.util.Date da = df.parse(date_acquired);
                //     book.setDate_acquired(da);
                // }catch(Exception ev) {
                //     ev.printStackTrace();
                // }
                e.printStackTrace();
            }

        s.add(book);
        this.reloadBookArrayList();
        this.reloadBookList();

        }

        addIsbnField.setText(null);
        addStatusField.setText(null);
        addPublisherField.setText(null);
        addTitleField.setText(null);
        addAuthorField.setText(null);
        //dayBox.setSelectedIndex(0);
        //monthBox.setSelectedIndex(0);
        yearBox.setSelectedIndex(0);
        dayBox1.setSelectedIndex(0);
        monthBox1.setSelectedIndex(0);
        yearBox1.setSelectedIndex(0);
             
}//GEN-LAST:event_addStudButtonActionPerformed

    private void resetAddStudFieldsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resetAddStudFieldsButtonActionPerformed
        addIsbnField.setText(null);
        addStatusField.setText(null);
        addPublisherField.setText(null);
        addTitleField.setText(null);
        addAuthorField.setText(null);
        //dayBox.setSelectedIndex(0);
        //monthBox.setSelectedIndex(0);
        yearBox.setSelectedIndex(0);
        dayBox1.setSelectedIndex(0);
        monthBox1.setSelectedIndex(0);
        yearBox1.setSelectedIndex(0);
        //addYearPublishedField.setText(null);
        //addDateAcquiredField.setText(null);
        //addDOBField.setText(null);
}//GEN-LAST:event_resetAddStudFieldsButtonActionPerformed

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
        String view = jComboBox1.getSelectedItem().toString();
        if (view.equals("View Available Books")){
            this.reloadAvailableBookArrayList();
            this.reloadBookList();
        }else if (view.equals("View Due Books")){
            this.reloadDueBookArrayList();
            this.reloadBookList();
        }else if (view.equals("View Borrowed Books")){
            this.reloadBorrowedBookArrayList();
            this.reloadBookList();
        }
    }//GEN-LAST:event_jComboBox1ActionPerformed

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
       
        //String s = monthBox2.getSelectedItem() + "/" + dayBox2.getSelectedItem() + "/" + yearBox2.getSelectedItem() ;
        
        String t = monthBox3.getSelectedItem() + "/" + dayBox3.getSelectedItem() + "/" + yearBox3.getSelectedItem() ;

        
            if (cmsc128.proj.iterc.dao.BookPeer.updateBook(Integer.parseInt(viewIdField.getText()), viewIsbnField.getText(), viewStatusField.getText(), viewPublisherField.getText(), viewTitleField.getText(), viewAuthorField.getText(), yearBox2.getSelectedItem().toString(), t) == false)
            {
              JOptionPane.showMessageDialog(null, "Missing Field", "Error", 1);
            }
            else{
                if (JOptionPane.showConfirmDialog(null, "Are you sure you want to save?", "Update Book", JOptionPane.OK_CANCEL_OPTION) == 0){
                cmsc128.proj.iterc.dao.BookPeer.updateBook(Integer.parseInt(viewIdField.getText()), viewIsbnField.getText(), viewStatusField.getText(), viewPublisherField.getText(), viewTitleField.getText(), viewAuthorField.getText(), yearBox2.getSelectedItem().toString(), t);
                viewAllBookButton.setEnabled(true);
                searchBookButton.setEnabled(true);
                deleteBookButton.setEnabled(true);
                jComboBox1.setEnabled(true);
                booksList.setEnabled(true);
                jTextField1.setEnabled(true);
                jTabbedPane2.setEnabled(true);
                updateBookButton.setVisible(true);
                //updateBookButton.setEnabled(false);
                //saveButton.setVisible(true);
                viewIdField.setText(null);
                viewIsbnField.setText(null);
                viewStatusField.setText(null);
                viewPublisherField.setText(null);
                viewTitleField.setText(null);
                viewAuthorField.setText(null);
                //viewYearPublishedField.setText(null);
                //viewDateAcquiredField.setText(null);
                //dayBox2.setEnabled(false);
                //monthBox2.setEnabled(false);
                yearBox2.setEnabled(false);
                dayBox3.setEnabled(false);
                monthBox3.setEnabled(false);
                yearBox3.setEnabled(false);
                //dayBox2.setSelectedItem(evt);
                //dayBox3.setSelectedItem(evt);
                viewIsbnField.setEditable(false);
                viewStatusField.setEditable(false);
                viewPublisherField.setEditable(false);
                viewTitleField.setEditable(false);
                viewAuthorField.setEditable(false);
                //viewYearPublishedField.setEditable(false);
                //viewDateAcquiredField.setEditable(false);
                this.reloadBookArrayList();
                this.reloadBookList();
                updateBookButton.setEnabled(false);
                deleteBookButton.setEnabled(false);
                }
            }

        
        
        
    }//GEN-LAST:event_saveButtonActionPerformed

    private void yearBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_yearBoxActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_yearBoxActionPerformed

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        InitTorque it = new InitTorque();
        it.init();
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new BooksView().setVisible(true);
            }
        });
    }
DefaultListModel bookList = new DefaultListModel();
    java.util.List<cmsc128.proj.iterc.dao.Book> s = new java.util.ArrayList<cmsc128.proj.iterc.dao.Book>(cmsc128.proj.iterc.dao.BookPeer.viewBooks());

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel addAddressLabel;
    private javax.swing.JLabel addAddressLabel1;
    private javax.swing.JTextField addAuthorField;
    private javax.swing.JLabel addCollegeLabel;
    private javax.swing.JLabel addCourseLabel;
    private javax.swing.JLabel addCourseLabel1;
    private javax.swing.JLabel addFirstNameLabel;
    private javax.swing.JTextField addIsbnField;
    private javax.swing.JLabel addLastNameLabel;
    private javax.swing.JLabel addMidInitLabel;
    private javax.swing.JTextField addPublisherField;
    private javax.swing.JTextField addStatusField;
    private javax.swing.JButton addStudButton;
    private javax.swing.JLabel addStudNoLabel;
    private javax.swing.JTextField addTitleField;
    private javax.swing.JList booksList;
    private javax.swing.JComboBox dayBox1;
    private javax.swing.JComboBox dayBox3;
    private javax.swing.JButton deleteBookButton;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTabbedPane jTabbedPane2;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JComboBox monthBox1;
    private javax.swing.JComboBox monthBox3;
    private javax.swing.JButton resetAddStudFieldsButton;
    private javax.swing.JButton saveButton;
    private javax.swing.JButton searchBookButton;
    private javax.swing.JButton updateBookButton;
    private javax.swing.JButton viewAllBookButton;
    private javax.swing.JTextField viewAuthorField;
    private javax.swing.JTextField viewIdField;
    private javax.swing.JTextField viewIsbnField;
    private javax.swing.JTextField viewPublisherField;
    private javax.swing.JTextField viewStatusField;
    private javax.swing.JTextField viewTitleField;
    private javax.swing.JComboBox yearBox;
    private javax.swing.JComboBox yearBox1;
    private javax.swing.JComboBox yearBox2;
    private javax.swing.JComboBox yearBox3;
    // End of variables declaration//GEN-END:variables

}
